package com.example.myqq.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.RelativeLayout;

import com.example.myqq.MainActivity;
import com.example.myqq.R;

/**
 * Created by Administrator on 2016/11/19.
 */

public class LoginActivity extends AppCompatActivity {
    private Context mContext;
    private RelativeLayout rl_user;
    private Button register;
    private Button mLogin;

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);
        mContext=this;
        findView();
        init();
    }

    private void findView() {
        rl_user=(RelativeLayout) findViewById(R.id.rl_user);
        mLogin= (Button) findViewById(R.id.login);
        register=(Button) findViewById(R.id.register);
    }
    private void init() {
        mLogin.setOnClickListener(loginOnClickListener);
        register.setOnClickListener(registerOnClickListener);
    }
    private View.OnClickListener loginOnClickListener=new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            //修改这个就可以改变主界面
            Intent intent=new Intent(mContext,MainActivity.class);
            startActivity(intent);
            finish();

        }
    };

    private View.OnClickListener registerOnClickListener=new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            //Intent intent=new Intent(mContext, RegisterPhoneActivity.class);
            //startActivity(intent);

        }
    };




}
